package wysiwyg.model
{
	import flash.display.DisplayObject;
	
	import mx.collections.ArrayCollection;
	import mx.containers.Canvas;
	
	import wysiwyg.layers.Layer;
	import wysiwyg.shapes.ShapeBase;
	[Bindable]
	public class Model
	{
		public var layersArray:ArrayCollection=new ArrayCollection();
		public var workspace:Canvas;
		public function Model()
		{
		}
		public function get selectedShapes():ArrayCollection
		{
			var tempCollection:ArrayCollection=new ArrayCollection();
			for each(var layer:Layer in layersArray)
			{
				for each(var shape:ShapeBase in layer.getChildrenShapes())
				{
					if(shape.selected)
					{
						tempCollection.addItem(shape);
					}
				}
			}
			return tempCollection;
		}
		public function get selectedLayers():ArrayCollection
		{
			var tempCollection:ArrayCollection=new ArrayCollection();
			for each(var layer:Layer in layersArray)
			{
				if(layer.selected)
				{
					tempCollection.addItem(layer);
				}
			}
			return tempCollection;
		}

	}
}